.class Lcom/instagram/android/nux/l;
.super Landroid/os/AsyncTask;
.source "FacebookHelper.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        "Lcom/instagram/android/nux/k;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic a:Lcom/instagram/android/nux/i;


# direct methods
.method private constructor <init>(Lcom/instagram/android/nux/i;)V
    .locals 0
    .parameter

    .prologue
    .line 73
    iput-object p1, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/instagram/android/nux/i;Lcom/instagram/android/nux/j;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 73
    invoke-direct {p0, p1}, Lcom/instagram/android/nux/l;-><init>(Lcom/instagram/android/nux/i;)V

    return-void
.end method

.method private a()V
    .locals 3

    .prologue
    .line 161
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 162
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V

    .line 163
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;Landroid/app/ProgressDialog;)Landroid/app/ProgressDialog;

    .line 165
    :cond_0
    new-instance v0, Lcom/instagram/ui/a/a;

    iget-object v1, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v1}, Lcom/instagram/android/nux/i;->e(Lcom/instagram/android/nux/i;)Landroid/app/Activity;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/instagram/ui/a/a;-><init>(Landroid/content/Context;)V

    sget v1, Lcom/facebook/ba;->error:I

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->b(I)Lcom/instagram/ui/a/a;

    move-result-object v0

    sget v1, Lcom/facebook/ba;->request_error:I

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->a(I)Lcom/instagram/ui/a/a;

    move-result-object v0

    sget v1, Lcom/facebook/ba;->dismiss:I

    new-instance v2, Lcom/instagram/android/nux/o;

    invoke-direct {v2, p0}, Lcom/instagram/android/nux/o;-><init>(Lcom/instagram/android/nux/l;)V

    invoke-virtual {v0, v1, v2}, Lcom/instagram/ui/a/a;->a(ILandroid/content/DialogInterface$OnClickListener;)Lcom/instagram/ui/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/ui/a/a;->b()Landroid/app/Dialog;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/Dialog;->show()V

    .line 174
    return-void
.end method


# virtual methods
.method protected varargs a([Ljava/lang/Void;)Lcom/instagram/android/nux/k;
    .locals 6
    .parameter

    .prologue
    const/4 v2, 0x0

    .line 78
    .line 86
    :try_start_0
    new-instance v0, Lch/boye/httpclientandroidlib/impl/client/DefaultHttpClient;

    invoke-direct {v0}, Lch/boye/httpclientandroidlib/impl/client/DefaultHttpClient;-><init>()V

    .line 88
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "https://graph.facebook.com/me?method=GET&fields=id,name,first_name,last_name,username,email&access_token="

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 91
    new-instance v3, Lch/boye/httpclientandroidlib/client/methods/HttpGet;

    invoke-direct {v3, v1}, Lch/boye/httpclientandroidlib/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    invoke-interface {v0, v3}, Lch/boye/httpclientandroidlib/client/HttpClient;->execute(Lch/boye/httpclientandroidlib/client/methods/HttpUriRequest;)Lch/boye/httpclientandroidlib/HttpResponse;

    move-result-object v0

    .line 93
    invoke-interface {v0}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v3

    .line 95
    :try_start_1
    invoke-static {}, Lcom/instagram/android/service/f;->a()Lcom/instagram/android/service/f;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_7

    move-result-object v0

    .line 98
    :try_start_2
    invoke-interface {v3}, Lch/boye/httpclientandroidlib/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v1

    const-class v4, Lcom/fasterxml/jackson/databind/JsonNode;

    invoke-virtual {v0, v1, v4}, Lcom/instagram/android/service/f;->readValue(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    .line 100
    new-instance v1, Lcom/instagram/android/nux/k;

    iget-object v4, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-direct {v1, v4}, Lcom/instagram/android/nux/k;-><init>(Lcom/instagram/android/nux/i;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_7

    .line 101
    :try_start_3
    const-string v4, "first_name"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    invoke-virtual {v4}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    iput-object v4, v1, Lcom/instagram/android/nux/k;->a:Ljava/lang/String;

    .line 102
    const-string v4, "first_name"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    invoke-virtual {v4}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    iput-object v4, v1, Lcom/instagram/android/nux/k;->b:Ljava/lang/String;

    .line 103
    const-string v4, "name"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    invoke-virtual {v4}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    iput-object v4, v1, Lcom/instagram/android/nux/k;->c:Ljava/lang/String;

    .line 104
    const-string v4, "email"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    if-eqz v4, :cond_2

    const-string v4, "email"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    invoke-virtual {v4}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    :goto_0
    iput-object v4, v1, Lcom/instagram/android/nux/k;->d:Ljava/lang/String;

    .line 105
    const-string v4, "username"

    invoke-virtual {v0, v4}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v4

    if-eqz v4, :cond_0

    const-string v2, "username"

    invoke-virtual {v0, v2}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v2

    :cond_0
    iput-object v2, v1, Lcom/instagram/android/nux/k;->e:Ljava/lang/String;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_9
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_8

    move-object v0, v1

    .line 116
    :goto_1
    if-eqz v3, :cond_1

    .line 118
    :try_start_4
    invoke-static {v3}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_6

    .line 129
    :cond_1
    :goto_2
    return-object v0

    :cond_2
    move-object v4, v2

    .line 104
    goto :goto_0

    .line 108
    :catch_0
    move-exception v0

    move-object v1, v2

    .line 109
    :goto_3
    :try_start_5
    invoke-direct {p0}, Lcom/instagram/android/nux/l;->a()V

    .line 110
    invoke-static {}, Lcom/instagram/android/nux/i;->d()Ljava/lang/String;

    move-result-object v2

    const-string v4, "Unable to parse Facebook user info"

    invoke-static {v2, v4, v0}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_8

    move-object v0, v1

    goto :goto_1

    .line 113
    :catch_1
    move-exception v0

    move-object v0, v2

    .line 114
    :goto_4
    :try_start_6
    invoke-direct {p0}, Lcom/instagram/android/nux/l;->a()V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_3

    .line 116
    if-eqz v2, :cond_1

    .line 118
    :try_start_7
    invoke-static {v2}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_2
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_6

    goto :goto_2

    .line 119
    :catch_2
    move-exception v1

    goto :goto_2

    .line 116
    :catchall_0
    move-exception v0

    move-object v3, v2

    move-object v1, v2

    :goto_5
    if-eqz v3, :cond_3

    .line 118
    :try_start_8
    invoke-static {v3}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_8
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_5
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_3

    .line 121
    :cond_3
    :goto_6
    :try_start_9
    throw v0
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_3

    .line 125
    :catch_3
    move-exception v0

    move-object v0, v1

    .line 126
    :goto_7
    invoke-static {}, Lcom/instagram/android/nux/i;->d()Ljava/lang/String;

    move-result-object v1

    const-string v2, "An error occurred fetching the Facebook user info"

    invoke-static {v1, v2}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2

    .line 119
    :catch_4
    move-exception v1

    goto :goto_2

    :catch_5
    move-exception v2

    goto :goto_6

    .line 125
    :catch_6
    move-exception v1

    goto :goto_7

    .line 116
    :catchall_1
    move-exception v0

    move-object v1, v2

    goto :goto_5

    :catchall_2
    move-exception v0

    goto :goto_5

    :catchall_3
    move-exception v1

    move-object v3, v2

    move-object v5, v1

    move-object v1, v0

    move-object v0, v5

    goto :goto_5

    .line 113
    :catch_7
    move-exception v0

    move-object v0, v2

    move-object v2, v3

    goto :goto_4

    :catch_8
    move-exception v0

    move-object v2, v3

    move-object v0, v1

    goto :goto_4

    .line 108
    :catch_9
    move-exception v0

    goto :goto_3
.end method

.method protected a(Lcom/instagram/android/nux/k;)V
    .locals 2
    .parameter

    .prologue
    .line 134
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->b(Lcom/instagram/android/nux/i;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/instagram/android/nux/m;

    invoke-direct {v1, p0}, Lcom/instagram/android/nux/m;-><init>(Lcom/instagram/android/nux/l;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 143
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->c(Lcom/instagram/android/nux/i;)Lcom/instagram/android/nux/q;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 144
    if-eqz p1, :cond_1

    .line 145
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->b(Lcom/instagram/android/nux/i;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/instagram/android/nux/n;

    invoke-direct {v1, p0, p1}, Lcom/instagram/android/nux/n;-><init>(Lcom/instagram/android/nux/l;Lcom/instagram/android/nux/k;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 157
    :cond_0
    :goto_0
    invoke-super {p0, p1}, Landroid/os/AsyncTask;->onPostExecute(Ljava/lang/Object;)V

    .line 158
    return-void

    .line 154
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/nux/l;->a()V

    goto :goto_0
.end method

.method protected synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter "x0"

    .prologue
    .line 73
    check-cast p1, [Ljava/lang/Void;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/instagram/android/nux/l;->a([Ljava/lang/Void;)Lcom/instagram/android/nux/k;

    move-result-object v0

    return-object v0
.end method

.method protected synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 73
    check-cast p1, Lcom/instagram/android/nux/k;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/instagram/android/nux/l;->a(Lcom/instagram/android/nux/k;)V

    return-void
.end method

.method protected onPreExecute()V
    .locals 8

    .prologue
    const/4 v7, 0x1

    .line 178
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->c(Lcom/instagram/android/nux/i;)Lcom/instagram/android/nux/q;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 179
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    new-instance v1, Landroid/app/ProgressDialog;

    iget-object v2, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v2}, Lcom/instagram/android/nux/i;->e(Lcom/instagram/android/nux/i;)Landroid/app/Activity;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    invoke-static {v0, v1}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;Landroid/app/ProgressDialog;)Landroid/app/ProgressDialog;

    .line 180
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v1}, Lcom/instagram/android/nux/i;->e(Lcom/instagram/android/nux/i;)Landroid/app/Activity;

    move-result-object v1

    sget v2, Lcom/facebook/ba;->connecting_to_x:I

    new-array v3, v7, [Ljava/lang/Object;

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v5}, Lcom/instagram/android/nux/i;->e(Lcom/instagram/android/nux/i;)Landroid/app/Activity;

    move-result-object v5

    sget v6, Lcom/facebook/ba;->facebook:I

    invoke-virtual {v5, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Landroid/app/Activity;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 183
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    invoke-virtual {v0, v7}, Landroid/app/ProgressDialog;->setCancelable(Z)V

    .line 184
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    invoke-virtual {v0, v7}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 185
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    new-instance v1, Lcom/instagram/android/nux/p;

    invoke-direct {v1, p0}, Lcom/instagram/android/nux/p;-><init>(Lcom/instagram/android/nux/l;)V

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 193
    iget-object v0, p0, Lcom/instagram/android/nux/l;->a:Lcom/instagram/android/nux/i;

    invoke-static {v0}, Lcom/instagram/android/nux/i;->a(Lcom/instagram/android/nux/i;)Landroid/app/ProgressDialog;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->show()V

    .line 195
    :cond_0
    return-void
.end method
